<ion-header class="header">
    <ion-toolbar content-page>
        <ion-buttons start>
            <button ion-button icon-only (click)="backClickHandle($event)">
                <i class="cancelBtn">取消</i>
            </button>
        </ion-buttons>
        <ion-title>
            <span *ngIf="opType!=2 && clientNoteModel.contentType==1">添加跟进文字</span>
            <span *ngIf="opType!=2 && clientNoteModel.contentType==2">添加跟进语音</span>
            <span *ngIf="opType===2">跟进详情</span>
        </ion-title>
        <ion-buttons end>
            <button ion-button icon-only *ngIf="clientNoteModel.noteType!=4" (click)="save()">
                <i class="settings">保存</i>
            </button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

<ion-content>
    <ion-list>
        <ion-item class="content-contain word device-pixel-border-bottom"  *ngIf="opType!=2&&clientNoteModel.contentType==1">
            <ion-textarea autoresize="{{texareaHeight}}"  autocomplete="off" autocorrect="off"
                          placeholder="请输入内容..."
                          [(ngModel)]="clientNoteModel.content" #noteText  (paste)="editFontNote($event,false)"  (input)="editFontNote($event,false)" (ionChange)="editFontNote($event,true)" (focus)="remarkCursor($event)"></ion-textarea>
        </ion-item>
    </ion-list>
    <ion-item class="content-contain word device-pixel-border-bottom"  *ngIf="opType===2&&clientNoteModel.contentType==1">
        <ion-textarea  autoresize="{{texareaHeight}}"  [disabled]="clientNoteModel.noteType===4"
                      placeholder="请输入内容..."
                      [(ngModel)]="clientNoteModel.content" #editNoteText (paste)="editFontNote($event,false)" (input)="editFontNote($event,false)" (ionChange)="editFontNote($event,true)"  (focus)="remarkCursor($event)"></ion-textarea>
    </ion-item>
    <ion-item class="voice-contain device-pixel-border-bottom" *ngIf="clientNoteModel.contentType==2&&!clientNoteModel.voiceUrl">
        <span class="voice-tip">请按住底部录音按钮说话...</span>
    </ion-item>
    <ion-list *ngIf="clientNoteModel.contentType==2&&clientNoteModel.voiceUrl">
        <ion-item-sliding #slidingItem *ngIf="clientNoteModel.contentType==2">
            <ion-item class="voice-contain  device-pixel-border-bottom" [class.download]="downloadTimerLength>=2">
                <!--语音播放组件-->
                <adp-voice-player [voiceUrl]="voiceFile" [voiceLength]="voiceLength" [id]="id" [isNewVoice]="isNewVoice"></adp-voice-player>
            </ion-item>
            <ion-item-options side="right">
                <button ion-button (click)="deleteVoice($event,slidingItem)">
                    <i></i>
                </button>
            </ion-item-options>
        </ion-item-sliding>
    </ion-list>
    <ion-item class="type-contain device-pixel-border-bottom">
        <ion-label>类型</ion-label>
        <ion-icon name="arrow" item-end></ion-icon>
        <ion-select cancelText="取消" interface="action-sheet" [(ngModel)]="clientNoteModel.noteType">
            <ion-option value=1 (ionSelect)="selectType(1)">销售</ion-option>
            <ion-option value=2 (ionSelect)="selectType(2)">增员</ion-option>
            <ion-option value=3 (ionSelect)="selectType(3)">其他</ion-option>
        </ion-select>
    </ion-item>
    <ion-item class="schedule-contain device-pixel-border-bottom">
        <ion-label> 同步到日程</ion-label>
        <ion-toggle color="secondary" [(ngModel)]="addSchedule"></ion-toggle>
    </ion-item>
    <!--关联日程组件-->
    <adp-relate-schedule [endRepeat]="endRepeat" (scheduleTigger)="scheduleTigger($event)" [addSchedule]="addSchedule"></adp-relate-schedule>
    <!--笔记删除按钮-->
    <ion-item class="btn-delete-contain" id="btn-contain" *ngIf="opType===2">
        <button *ngIf="clientNoteModel.noteType!=4" class="btn-del" (click)="delete()">删&emsp;除</button>
    </ion-item>
    <!--底部栏填充-->
    <div class="bottom-part"></div>
</ion-content>
<!--录音组件-->
<adp-media-audio (audioSuccess)="recordSuccess($event)" [audioStatus]="audioStatus" [audioBtn]="audioBtn" *ngIf="clientNoteModel.contentType==2&&!clientNoteModel.voiceUrl&&leavePage"></adp-media-audio>
